import cv2

# 图像读取与预处理
img = cv2.imread('./images/lena.png')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# Canny边缘检测
edges = cv2.Canny(gray, 100, 200)

# 绘制
cv2.imshow('Canny', edges)
cv2.waitKey(0)